package cate.game.framework.advanced;

import easy.java.practice.errorcode.EcResult;
import lombok.Data;
import lombok.ToString;
import reactor.core.publisher.Flux;

import javax.annotation.Nullable;

public interface AdvancedRankHandler<T> {

    @ToString
    @Data
    class AdmireParam {
        private String uid;
        private int rankId;

        public static AdmireParam of(String uid, int rankId) {
            AdmireParam param = new AdmireParam();
            param.setUid(uid);
            param.setRankId(rankId);
            return param;
        }
    }

    int getRankId();

    int getRankLimit();

    EcResult<Void> admire(String uid, int rank);

    int getIndex(String uid);

    @Nullable
    T getData(String uid);

    Flux<T> getRankFlow();
}
